/*
 * Copyright Iain Sproat, 2009
 * 
 *
 */
using System;

namespace FreeBase.Domain
{
	/// <summary>
	/// This is the equivalent of freebase /type/int
	/// </summary>
	public class FBInt :FBValueType<int>
	{
		public FBInt()
		{
		}
		public FBInt( string val )
		{
			this.Value = int.Parse(val);
		}
		
		public override int Value{ get; set; }
		
		public static implicit operator FBInt( int intValue )
		{
			FBInt i = new FBInt();
			i.Value = intValue;
			return i;
		}
		
		public static implicit operator FBInt( string intValue )
		{
			if( string.IsNullOrEmpty( intValue ) )
				throw new ArgumentNullException( "intValue" );
			FBInt i = new FBInt();
			i.Value = Int32.Parse( intValue );
			return i;
		}
	}
}
